import java.util.Scanner;
public class Mainxx{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        char[] chArr = str.toCharArray();
        char U='U';int u=0;
        char D='D';int d=0;
        char L='L';int l=0;
        char R='R';int r=0;
        for (int i=0;i<chArr.length;i++){
                if (chArr[i]==U) {
                    u++;
                }else if(chArr[i]==D){
                    d++;
                }else if (chArr[i]==L){
                    l++;
                }else if (chArr[i]==R){
                    r++;
                }
        }
        int x=d-u;
        int y=r-l;
        System.out.print(x+" "+y);
    }
}
